﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Text;

namespace AI
{
    public class RateInfo
    {

        public static RateInfo I = new RateInfo();


        public Vector[] BMPPos { 
            get{
                return _BMPPos;
            }
 
            set{
                _BMPPos = value;
            } 
        }
        Vector[] _BMPPos = new Vector[2];

        public Vector[] GPSPos
        {
            get
            {
                return _GPSPos;
            }

            set
            {
                _GPSPos = value;
            }
        }
        Vector [] _GPSPos = new Vector[2];
        Vector _Rate = new Vector();

        public RateInfo()
        {
            _BMPPos[0] = new Vector(608,82);
            _BMPPos[1] = new Vector(458, 451);


            _GPSPos[0] = new Vector(-122.3233, 47.6006);
            _GPSPos[1] = new Vector(-122.3239,47.6021);

            
            _Rate.X = (_GPSPos[0].X - _GPSPos[1].X) / (_BMPPos[0].X / _BMPPos[1].X);
            _Rate.Y = (_GPSPos[0].Y - _GPSPos[1].Y) / (_BMPPos[0].Y / _BMPPos[1].Y);
        }

        public Vector BMP2GPS(double x, double y)
        {
            return new Vector(x * _Rate.X, y * _Rate.Y);
        }
        

    }
}
